<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

$item_start = "<div class=\"i\">";
$item_end = "</div>";
$item_start_select = "<div class=\"s1\"><div class=\"s2\"><div class=\"s3\">";
$item_end_select = "</div></div></div>";

$index_start = $item_start;
$index_end = $item_end;

if (is_array($group_info)) {
    foreach ($group_info as $g) {
	$gs = "$g[gr_id]_start";
	$ge = "$g[gr_id]_end";
	$$gs = $item_start;
	$$ge = $item_end;
    }
}

if ($gr_id) {
    $gs = "{$gr_id}_start";
    $ge = "{$gr_id}_end";
    $$gs = $item_start_select;
    $$ge = $item_end_select;
} else {
    $index_start = $item_start_select;
    $index_end = $item_end_select;
}
?>

<link rel="stylesheet" href="<?=$mwus_skin_path?>/style.css" type="text/css"/>

<style type="text/css">
#us_group { background:url(<?=$mwus_skin_path?>/img/search_bar_bg.gif); height:32px; margin:0; padding:0; }
#us_group ul,
#us_group li { margin:0; padding:0; list-style-type:none; float:left; }
#us_group a { color:#fff; text-decoration:none; font-size:12px; }

#us_group .i { height:32px; float:left; padding:10px 10px 0 10px; }
#us_group .l { float:left; }
#us_group .r { float:right; }
#us_group .d { width:10px; height:32px; float:left; background:url(<?=$mwus_skin_path?>/img/search_bar_div.gif) center no-repeat; }
#us_group .s1 { height:28px; float:left; padding:0; margin:4px 5px 0 5px; background:url(<?=$mwus_skin_path?>/img/search_select_bg.gif); }
#us_group .s2 { height:28px; float:left; background:url(<?=$mwus_skin_path?>/img/search_select_left.gif) top left no-repeat; padding:0; margin:0; }
#us_group .s3 { height:28px; float:left; padding:7px 10px 0 10px; margin:0; background:url(<?=$mwus_skin_path?>/img/search_select_right.gif) top right no-repeat; }
#us_group .s3 a { color:#000; font-weight:bold; }
</style>

<div id="us_container">

<div id="us_form">
    <div class="logo"><a href="<?=$g4[path]?>"><img src="<?=$mwus_skin_path?>/img/mw_logo.gif"></a></div>
    <form name="fsearch" method="get" action="<?=$g4[path]?>/plugin/united-search/index.php">
    	



    <input type="hidden" name="gr_id" value="<?=$gr_id?>">
    <div class="us_input_box"><input type="text" name="stx" class="us_input" itemname="검색어" value="<?=$stx?>"></div>
    <input type="submit" class="us_button" value="검색" onfocus="this.blur()">
    <? if ($is_admin == "super") { ?>
        <input type="button" class="us_button" value="관리자" onclick="win_open('admin.php','us_admin_win','width=800,height=600');">
    <? } ?>
    </form>
</div>

<div id="us_group">
    <div class="l"><img src="<?=$mwus_skin_path?>/img/search_bar_left.gif"></div>
    <ul>
	<li> <?=$index_start?><a href="<?=$mwus[path]?>/?stx=<?=$encode_stx?>">통합검색</a><?=$index_end?> <span class="d"></span> </li>

	<? if (is_array($group_info)) { foreach ($group_info as $g) { $gs = "$g[gr_id]_start"; $ge = "$g[gr_id]_end"; ?>
	<li> <?=$$gs?><a href="<?=$mwus[path]?>/?gr_id=<?=$g[gr_id]?>&stx=<?=$encode_stx?>"><?=$g[gr_subject]?></a><?=$$ge?><span class="d"></span> </li>
	<? } } ?>
    </ul>
    <div class="r"><img src="<?=$mwus_skin_path?>/img/search_bar_right.gif"></div>
</div>


